<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: Tang'ya'kang
  Date: 2023/5/7
  Time: 20:05
  To change this template use File | Settings | File Templates.
--%>
<%@  page contentType="text/html;charset=UTF-8" language="java" errorPage="error500.jsp" %>

<html>
<head>
    <title>jsp1</title>
</head>
<body>
<%--    <% int i=5/0; %>--%>
<%--        声明脚本格式->  <%!   %>    --%>
<%!  private Integer id;
     private String username;
     private String password;
     private static Map<String ,Object>map;
%>

<%!
    static {
        map=new HashMap<String, Object>();
        map.put("key1","value1");
        map.put("key2","value1");
        map.put("key3","value1");
        map.put("key4","value1");

    }
%>

<%!
    public int abs(){
        return 12;
    }
%>


<%--    表达式脚本格式-> <%= 表达式  %>
        作用：在jsp页面输出数据。
--%>
<%=1%> <br/>
<%=1.1111111111111%> <br/>
<%="汤亚康"%><br/>
<%=map%><br/>
<%=request.getParameter("name")%>


<%--    代码脚本格式-> <%     java代码      %>      --%>
<%--    作用:可以在jsp页面中编写我们增加需要的功能(写的是java语句，方法的话得用声明脚本)     --%>

<%
    int x=13;
    if(x==12) System.out.println("tyk好帅");
    else System.out.println("tyk更帅");

    System.out.println(request.getMethod());
    for (int i=1;i<=10;++i)
    {
%>
        <div style="background-color: red">第<%=i%>个div</div>
<%
    }
%>
</body>
</html>
